<template>
    <div class="menu">
        <el-menu
            default-active="1"
            class="el-menu-vertical-demo"
            @select="handleSelect"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
            <el-menu-item index="1" class="my-menu-item">
                <i class="el-icon-menu"></i>
                <span slot="title">数据</span>
            </el-menu-item>
            <el-menu-item index="2" class="my-menu-item">
                <i class="el-icon-document"></i>
                <span slot="title">功能</span>
            </el-menu-item>
            <el-menu-item index="3" class="my-menu-item">
                <i class="el-icon-setting"></i>
                <span slot="title">工具</span>
            </el-menu-item>
        </el-menu>
    </div>
</template>

<script>
export default {
    computed: {
        
    },
    methods: {
        handleSelect(key, keyPath){
            console.log(key, keyPath);
            this.$store.commit("setMenuIndex", key);
        },
    }
}
</script>

<style lang="less">
    .menu {
        position: relative;
        height: 100%;
        width: 68px;
        background-color: #545c64;
        .my-menu-item{
            padding: 10px 0 10px 40px;
            i{
                display: block;
            }
            span{
                display: block;
                line-height: 20px;
            }
        }
    }
</style>

